import java.util.HashSet;
import java.util.Scanner;

public class NGuessNumber {
    public HashSet<Integer> generateAnswer(){
        HashSet<Integer> lyz = new HashSet<>();
        while (lyz.size() < 4){
            int num = (int)(Math.random()*10);
            lyz.add(num);
        }
        return lyz;
    }
    public int[] getPlayerInput(){
        int[] lyz = new int[4];
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < lyz.length; i++) {
            lyz[i] = input.nextInt();
        }
        return lyz;
    }
    public boolean compareGuessAnswer(){
        NGuessNumber lyz = new NGuessNumber();
        HashSet<Integer> integers = lyz.generateAnswer();
        int[] playerInput = lyz.getPlayerInput();
        for (int n: integers) {
            for (int a:playerInput) {
                if (n==a){
                    return true;
                }
                return false;
            }
        }
        return false;
    }
}
